import 'package:cbec_app/entity/home/content/content_data.dart';

class SearchContentModel extends ContentData {
     String? borderStyleColor;
     String? color;
    //  List<String>? hotSearchKeys;
     String? textAlignMethod;
     String? uuid;
     String? positionShowMethod;
     String? showScan;
     int? borderStyleHeight;
    //  List<String>? hotSearchKeysNew;
     String? textColor;
     String? borderStyleMethod;
     String? showSearchComponent;
     String? positionType;

  // 构造函数
  SearchContentModel({
      this.borderStyleColor,
      this.color,
      // this.hotSearchKeys,
      this.textAlignMethod,
      this.uuid,
      this.positionShowMethod,
      this.showScan,
      this.borderStyleHeight,
      // this.hotSearchKeysNew,
      this.textColor,
      this.borderStyleMethod,
      this.showSearchComponent,
      this.positionType,
  }) {
    type = 'search'; // 设置抽象属性
  }

  
  factory SearchContentModel.fromJson(Map<String, dynamic> json) {
    return SearchContentModel(
      borderStyleColor: json['border_style_color'] ?? '',
      color: json['color'] ?? '',
      // hotSearchKeys: List<String>.from(json['hot_search_keys'] ?? []),
      textAlignMethod: json['text_align_method'] ?? '0',
      uuid: json['uuid'] ?? '',
      positionShowMethod: json['position_show_method'] ?? '0',
      showScan: json['show_scan'] ?? '0',
      borderStyleHeight: json['border_style_height'] ?? 40,
      // hotSearchKeysNew: List<String>.from(json['hot_search_keys_new'] ?? []),
      textColor: json['text_color'] ?? '#969799',
      borderStyleMethod: json['border_style_method'] ?? '0',
      showSearchComponent: json['show_search_component'] ?? '1',
      positionType: json['position_type'] ?? '',
    );
  }

  @override
  ContentData fromJson(Map<String, dynamic> json) {
    return SearchContentModel.fromJson(json);
  }

  @override
  Map<String, dynamic> toJson() {
    return {
      'border_style_color': borderStyleColor,
      'color': color,
      // 'hot_search_keys': hotSearchKeys,
      'text_align_method': textAlignMethod,
      'uuid': uuid,
      'position_show_method': positionShowMethod,
      'show_scan': showScan,
      'border_style_height': borderStyleHeight,
      // 'hot_search_keys_new': hotSearchKeysNew,
      'text_color': textColor,
      'border_style_method': borderStyleMethod,
      'show_search_component': showSearchComponent,
      'position_type': positionType,
    };
  }
}
